import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from './../views/login/Login'
import Home from './../views/home/Home'
import Layout from '../components/layout/Layout'
import Member from '../views/member/Member'
import Staff from '../views/staff/Staff'
import Supplier from '../views/supplier/Supplier'
import Goods from '../views/goods/Goods'
// import 404 from '../views/errorPage/404'

Vue.use(VueRouter)

const routes = [
  { path: '/', redirect: '/login' },
  { path: '/login', component: Login },
  {
    path: '/layout',
    component: Layout,
    redirect: 'Home',
    children: [
      { path: '/home', component: Home, meta: { title: '首页' } },
      { path: '/member', component: Member, meta: { title: '会员管理' } },
      { path: '/supplier', component: Supplier, meta: { title: '供应商管理' } },
      { path: '/goods', component: Goods, meta: { title: '商品管理' } },
      { path: '/staff', component: Staff, meta: { title: '员工管理' } }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
